home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Games / MoofWars / MoofEncoder / GridEncode.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  1.8 KB  |  49 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        GridEncode.h
  3.  
  4.     Contains:    This is just a very simple encoder that shows how to build GRID and TILE
  5.                 resources.  The TILE resource is a set of 32x32x1 byte tiles.  This encoder
  6.                 takes a picture and dices it into 32x32 tiles, which it writes out to output
  7.                 file.  It then builds a standard grid, repeating the original picture as a 
  8.                 pattern across the grid.
  9.     
  10.                  Eventually, it would be nice to make a program that lets someone graphically
  11.                  edit the available list of tiles and the actual GRID resource, much like any 
  12.                  number of map editors out for various games.
  13.     
  14.  
  15.     Written by: Timothy Carroll    
  16.  
  17.     Copyright:    Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved.
  18.  
  19.                 You may incorporate this Apple sample source code into your program(s) without
  20.                 restriction. This Apple sample source code has been provided "AS IS" and the
  21.                 responsibility for its operation is yours. You are not permitted to redistribute
  22.                 this Apple sample source code as "Apple sample source code" after having made
  23.                 changes. If you're going to re-distribute the source, we require that you make
  24.                 it clear in the source that the code was descended from Apple sample source
  25.                 code, but that you've made changes.
  26.  
  27.     Change History (most recent first):
  28.                 7/1/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  29.                 8/15/96        Timothy Carroll    Initial Release
  30.                 
  31.  
  32. */
  33.  
  34. #ifndef _GRIDENCODE_
  35. #define _GRIDENCODE_
  36.  
  37. #pragma once
  38.  
  39. const int kPICTInputResID = 128;  // resource ID of the PICT to dice.
  40. const int kOutputResID = 500;     // resource ID used for the GRID and TILE output
  41.  
  42. const int kGridWidth = 44;
  43. const int kGridHeight = 44;
  44.  
  45. const int kTileSize = 1024;  // 32 x 32 x 1 byte
  46.  
  47. extern OSStatus GridTileEncode (short inputFileResNum, short outputFileResNum);
  48.  
  49. #endif // _GRIDENCODE_